package tabdulin.sms;

import static org.junit.Assert.*;

import java.io.IOException;

import org.junit.Test;

import tabdulin.sms.megafon.MegafonStatus;

public class StatusTest {

	@Test
	public void testGetResponseCode() {
		try {
			MegafonStatus status = new MegafonStatus (getClass().getResourceAsStream("/data/sent.html"));
			assertTrue(status.getLink().startsWith("/send/status/"));
		} catch (IOException e) {
			fail("IOException");
		}
	}

	@Test
	public void testGetLink() {
		try {
			MegafonStatus status = new MegafonStatus (getClass().getResourceAsStream("/data/sent.html"));
			assertNotNull(status.getLink());
			assertEquals("/send/status/451002CC0B54DD7F", status.getLink());
		} catch (IOException e) {
			fail("IOException");
		}
	}

}
